home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: Reading Formatted Text
- Sent: 6/12/96 4:59 AM
- Received: 6/12/96 8:31 AM
- From: Serge Froment, sfroment@odyssee.net
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- >Yes, efficiency might be a concern with the code you show. Suppose you
- >read in a couple hundred bytes (length==200), and there are no delimiters,
- >or \r characters. FW_CString::FindCharacter will have to make two passes
- >through the data to determine that.
-
- Yes, that is the point that concerned me. For that reason, I decided to
- fetch one character at a time from the reader and copy to the string only
- the characters up to the delimiter/return using a FW_CStringWriter. This
- class is optimized to copy characters to the string in 32-byte bundles, so
- the string buffer is not increased at every character. Doing it that way
- also takes care of the fact that FW_CString does not know about FW_LChar.
-
- At first, I had the impression FW_CString was missing some useful methods,
- but now that I see it can be used with text readers/writers, I really like
- the design.
-
- Thanks for your help.
-
- Serge
-
-